class Solution
{
public:
    vector<string> findRepeatedDnaSequences(string s)
    {
        int n = s.size();
        if (n < 10)
        {
            return {};
        }
        unordered_set<string> result;
        unordered_set<string> ss;
        for (int i = 0; i <= n - 10; ++i)
        {
            auto subSeq = s.substr(i, 10);
            if (ss.count(subSeq))
            {
                result.insert(subSeq);
            }
            else
            {
                ss.insert(subSeq);
            }
        }
        return {result.begin(), result.end()};
    }
};